import VueRouter from 'vue-router'

import Vue from 'vue'

import Home from 'pages/home/index.vue'
import UserList from 'pages/user_list'
import ShopList from 'pages/shop_list'
import ShopAdd from 'pages/shop_add'
import ShopEdit from 'pages/shop_edit'
import Visitor from 'pages/visitor'
import Explain from 'pages/explain'
import Error from 'pages/error'
import AdminSet from 'pages/admin_set'
import Edit from 'pages/edit'

Vue.use( VueRouter )

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    component: Home,
    name: 'home'
  },
  {
    path: '/user_list',
    component: UserList 
  },
  {
    path: '/shop_list',
    component: ShopList
  },
  {
    path: '/shop_add',
    component: ShopAdd
  },
  {
    path: '/shop_edit/:id',
    component: ShopEdit
  },
  {
    path: '/visitor',
    component: Visitor
  },
  {
    path: '/edit',
    component: Edit
  },
  {
    path: '/admin_set',
    component: AdminSet
  },
  {
    path: '/explain',
    component: Explain
  },
  {
    path: '/error',
    component: Error
  },
  {
    path: '**',
    redirect: '/error'
  }
]

const router = new VueRouter({
  routes,
  mode: 'history'
})

export default router 